package com.neusoft.neu24.nep.grid.controller;

import com.neusoft.neu24.nep.entity.ComonResult;
import com.neusoft.neu24.nep.grid.entity.Grid;
import com.neusoft.neu24.nep.grid.service.IGridService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 区域网格信息 前端控制器
 * </p>
 *
 * @author 段静迪，duanjingdi@163.com
 * @since 2024-05-29
 */
@RestController
@RequestMapping("/grid")
public class GridController {
    @Autowired
    IGridService gridService;

    @GetMapping("s/pid/{pid}")
    public ComonResult selectGridByPid(@PathVariable("pid")  Integer pid ) {
        return  gridService.selectGridByPid(pid);
    }

    @PostMapping("add")
    public ComonResult addGrid( @RequestBody Grid grid) {
        return  gridService.addGrid(grid);
    }

}
